home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / sys / RCS / fb.h,v < prev    next >
Text File  |  1990-06-21  |  5KB  |  203 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     90.06.21.14.53.02;  author mgbaker;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     90.06.05.14.06.01;  author mgbaker;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @First try at sun-compatible frame buffer device.
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @New /dev/fb stuff.
  28. @
  29. text
  30. @/*
  31.  * fb.h --
  32.  *
  33.  *    Declarations of things to do with the frame buffer device.
  34.  *
  35.  * Copyright 1990 Regents of the University of California
  36.  * Permission to use, copy, modify, and distribute this
  37.  * software and its documentation for any purpose and without
  38.  * fee is hereby granted, provided that the above copyright
  39.  * notice appear in all copies.  The University of California
  40.  * makes no representations about the suitability of this
  41.  * software for any purpose.  It is provided "as is" without
  42.  * express or implied warranty.
  43.  *
  44.  * $Header: /sprite/src/lib/include/sys/RCS/fb.h,v 1.1 90/06/05 14:06:01 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
  45.  */
  46.  
  47. #ifndef _FBDEV
  48. #define _FBDEV
  49.  
  50. #ifndef ASM
  51.  
  52. /* 
  53.  * Set/Get attributes 
  54.  */
  55. #define    FB_ATTR_NDEVSPECIFIC    8    /* no. of device specific values */
  56. #define    FB_ATTR_NEMUTYPES    4    /* no. of emulation types */
  57.  
  58. /* 
  59.  * Video control 
  60.  * (the unused bits are reserved for future use)
  61.  */
  62. #define    FBVIDEO_OFF    0
  63. #define    FBVIDEO_ON    1
  64.  
  65. /* frame buffer type codes */
  66. #define    FBTYPE_SUN1BW        0    /* Multibus mono */
  67. #define    FBTYPE_SUN1COLOR    1    /* Multibus color */
  68. #define    FBTYPE_SUN2BW        2    /* memory mono */
  69. #define    FBTYPE_SUN2COLOR    3    /* color w/rasterop chips */
  70. #define    FBTYPE_SUN2GP        4    /* GP1/GP2 */
  71. #define    FBTYPE_SUN5COLOR    5    /* RoadRunner accelerator */
  72. #define    FBTYPE_SUN3COLOR    6    /* memory color */
  73. #define    FBTYPE_MEMCOLOR        7    /* memory 24-bit */
  74. #define    FBTYPE_SUN4COLOR    8    /* memory color w/overlay */
  75.  
  76. #define    FBTYPE_NOTSUN1        9    /* reserved for customer */
  77. #define    FBTYPE_NOTSUN2        10    /* reserved for customer */
  78. #define    FBTYPE_NOTSUN3        11    /* reserved for customer */
  79.  
  80. #define    FBTYPE_SUNFAST_COLOR    12    /* accelerated 8bit */
  81. #define    FBTYPE_SUNROP_COLOR    13    /* MEMCOLOR with rop h/w */
  82. #define    FBTYPE_SUNFB_VIDEO    14    /* Simple video mixing */
  83. #define    FBTYPE_RESERVED5    15    /* reserved, do not use */
  84. #define    FBTYPE_RESERVED4    16    /* reserved, do not use */
  85. #define    FBTYPE_RESERVED3    17    /* reserved, do not use */
  86. #define    FBTYPE_RESERVED2    18    /* reserved, do not use */
  87. #define    FBTYPE_RESERVED1    19    /* reserved, do not use */
  88.  
  89. #define    FBTYPE_LASTPLUSONE    20    /* max number of fbs (change as add) */
  90.  
  91. /* data structures */
  92. /*
  93.  * Frame buffer descriptor.
  94.  * Returned by FBIOGTYPE ioctl on frame buffer devices.
  95.  */
  96. typedef struct    fbtype {
  97.     int    fb_type;    /* as defined above */
  98.     int    fb_height;    /* in pixels */
  99.     int    fb_width;    /* in pixels */
  100.     int    fb_depth;    /* bits per pixel */
  101.     int    fb_cmsize;    /* size of color map (entries) */
  102.     int    fb_size;    /* total size in bytes */
  103. } fbtype;
  104.  
  105.  
  106. /*
  107.  * General purpose structure for passing info in and out of frame buffers
  108.  * (used for gp1)
  109.  */
  110. typedef struct    fbinfo {
  111.     int        fb_physaddr;    /* physical frame buffer address */
  112.     int        fb_hwwidth;    /* fb board width */
  113.     int        fb_hwheight;    /* fb board height */
  114.     int        fb_addrdelta;    /* phys addr diff between boards */
  115.     unsigned char    *fb_ropaddr;    /* fb va thru kernelmap */
  116.     int        fb_unit;    /* minor devnum of fb */
  117. } fbinfo;
  118.  
  119.  
  120.  
  121. /*
  122.  * Color map I/O
  123.  */
  124. typedef struct    fbcmap {
  125.     int        index;        /* first element (0 origin) */
  126.     int        count;        /* number of elements */
  127.     unsigned char    *red;        /* red color map elements */
  128.     unsigned char    *green;        /* green color map elements */
  129.     unsigned char    *blue;        /* blue color map elements */
  130. } fbcmap;
  131.  
  132.  
  133. typedef struct fbsattr {
  134.     int    flags;            /* misc flags */
  135. #define    FB_ATTR_AUTOINIT    1    /* emulation auto init flag */
  136. #define    FB_ATTR_DEVSPECIFIC    2    /* dev. specific stuff valid flag */
  137.     int    emu_type;        /* emulation type (-1 if unused) */
  138.     int    dev_specific[FB_ATTR_NDEVSPECIFIC];    /* catchall */
  139. } fbsattr;
  140.  
  141.  
  142. typedef struct fbgattr {
  143.     int    real_type;        /* real device type */
  144.     int    owner;            /* PID of owner, 0 if myself */
  145.     struct    fbtype fbtype;        /* fbtype info for real device */
  146.     struct    fbsattr sattr;        /* see above */
  147.     int    emu_types[FB_ATTR_NEMUTYPES];    /* possible emulations */
  148.                         /* (-1 if unused) */
  149. } fbgattr;
  150.  
  151. struct    fbpixrect {
  152.     struct pixrect    *fbpr_pixrect;    /* Pixrect of dev returned here. */
  153. };
  154.  
  155. #endif !ASM
  156.  
  157. #endif /* _FBDEV */
  158. @
  159.  
  160.  
  161. 1.1
  162. log
  163. @Initial revision
  164. @
  165. text
  166. @d15 1
  167. a15 1
  168.  * $Header: /sprite/lib/forms/RCS/proto.h,v 1.5 90/01/12 12:03:25 douglis Exp $ SPRITE (Berkeley)
  169. a22 12
  170. /* constants */
  171. #define    FBIOGTYPE                0
  172. #define FBIOGINFO                1
  173. #define FBIOPUTCMAP                2
  174. #define FBIOGETCMAP                3
  175. #define    FBIOSATTR                4
  176. #define    FBIOGATTR                5
  177. #define    FBIOSVIDEO                6
  178. #define    FBIOGVIDEO                7
  179. /* Vertical retrace support. */
  180. #define FBIOVERTICAL                8
  181.  
  182. a75 1
  183. typedef    fbtype    FBType;
  184. a89 1
  185. typedef    fbinfo    FBInfo;
  186. a102 1
  187. typedef    fbcmap    FBCMap;
  188. a111 1
  189. typedef    fbsattr    FBSAttr;
  190. d116 2
  191. a117 2
  192.     struct FBType fbtype;        /* fbtype info for real device */
  193.     struct FBSAttr sattr;        /* see above */
  194. d122 3
  195. a124 6
  196. typedef    fbgattr    FBGAttr;
  197.  
  198. extern    ReturnStatus    DevFBOpen();
  199. extern    ReturnStatus    DevFBIOControl();
  200. extern    ReturnStatus    DevFBClose();
  201. extern    ReturnStatus    DevFBMMap();
  202. @
  203.